# Reference: <https://postmarketos.org/devicepkg>
# Maintainer:
pkgname=device-beelink-gt1
pkgver=2
pkgrel=1
pkgdesc="Beelink gt1 (Ultimate)"
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="postmarketos-base u-boot-amlogic-beelink-gt1 soc-amlogic-s905"
makedepends="devicepkg-dev"
subpackages="
	$pkgname-kernel-alpine:kernel_alpine
	$pkgname-kernel-amlogic:kernel_amlogic
	$pkgname-nonfree-firmware:nonfree_firmware
	"
source="
	asound.state
	deviceinfo modules-initfs.alpine modules-initfs.amlogic"

build() {
	devicepkg_build $startdir $pkgname
}

package() {
	devicepkg_package $startdir $pkgname
	install -D -m644 "$srcdir"/asound.state \
		"$pkgdir"/var/lib/alsa/asound.state
}

kernel_alpine() {
	pkgdesc="linux-edge from Alpine"
	depends="linux-edge"
	devicepkg_subpackage_kernel $startdir $pkgname $subpkgname
}

kernel_amlogic() {
	pkgdesc="linux-postmarketos-amlogic from postmarketOS"
	depends="linux-postmarketos-amlogic"
	devicepkg_subpackage_kernel $startdir $pkgname $subpkgname
}

nonfree_firmware() {
	pkgdesc="Beelink gt1 Firmware"
	depends="firmware-beelink-gt1 linux-firmware-meson"
	mkdir "$subpkgdir"
}


sha512sums="
a38e33d5bce26549c73f9aad2988ef8d7e7a3bbb28ac37348545fe7edb935be1b51dbdf8a857fb9d49be7e6eab7d40ac2f11fdcd618487747b809f7236ccf57b  asound.state
b6099ab1d0f1f0f7d00c65275d0f5366793adf8755296408e0494decf4f6740e425ed1013c9940bdb869e66283b890b3e7446fbf171f3da692b1b67c9381c23f  deviceinfo
b9f3e1902c17909de928c99868265a257ba5873f6ea6aa1097ad10721f59d68342d50ee51992472ecd23722f7664a13dd15f4e26071a40595c7c3e5161e533d7  modules-initfs.alpine
52948c2884a6f6384e12b7a598f70878526d0d3293c214425170145231144ec7de805c038641741a4a5d75b50e554f6a3fa3769784a674217ed032f9b6a233c8  modules-initfs.amlogic
"
